﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*,
                 com.kylin.common.*,
                 com.kylin.common.util.*,
                 com.kylin.module.user.orm.*,
				 com.kylin.module.shop.orm.*,
				 com.kylin.common.dict.orm.Dict,
                 com.kylin.common.paginate.DisplayPage,
                 com.kylin.module.community.orm.Member
				 " %>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
<%@ include file="/common/include/pageExpires.jsp"%>

<%@ page import="com.kylin.module.specials.orm.Special"%>

<script>
   var theform = document.specialForm;
	function checkSubmit(nextdo){
		if(theform.language.value==document.fo1.targetlang.value){
		    alert("母语和学习语言不能相同")
		    return;
		}
		if(theform.catspecial.value==""){
		    alert("请选择类别")
		    return;
		}
	    theform.submit();
	}
</script>

<br>
<mytag:MyActionMsg />
<html:form action="/admin/special/manageSpecial.do?CMD=add"	method="post" enctype="multipart/form-data">
	<table width="90%" cellspacing="0" cellpadding="0">
		<tr>
			<td class='pageTd' width="100">
				母语
			</td>
			<td>
				<mytag:national name="language" notEmpty="true"
					onchange="changeSelect(this.value)" value="<%=request.getParameter("language") %>"
					dictName="<%=Constants.SYSLANGUAGE%>" />
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				专题分类
			</td>
			<td>
      <select name="catspecial">
		<option value="">-- 请选择 --</option>
	  </select>
<div style="position:absolute; visibility:hidden; ">
  <mytag:select name="catspecialData" notEmpty="true" language="all" dictName="<%=dict_specials%>" />
  <script>
        theform = document.specialForm;
		function changeSelect(language){
			var dataList = theform.catspecialData;
			var targetList = theform.catspecial;
			targetList.length = 1;
		    for(var i=0;i<dataList.length;i++){
		       if(dataList.options[i].language==language){
		           targetList.length = targetList.length+1;
		           targetList.options[targetList.length-1].value = dataList.options[i].value;
		           targetList.options[targetList.length-1].text  = dataList.options[i].text;	 
//alert("length="+targetList.length+"\n add "+dataList.options[i].text);          
		       }
		    }
		}
		changeSelect(theform.language.value); //页面显示后直接初始化
   </script>  
</div>


			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				文章标题
			</td>
			<td>
				<html:text property="title"/>
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				文章内容
			</td>
			<td>
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<FCK:editor id="content" basePath="/common/webeditor/"
		autoDetectLanguage="false"
		defaultLanguage="<%=JspHelper.getFCKLang("zh_CN") %>"
		imageUploadURL="/editor/filemanager/upload/simpleuploader?Type=Image"
		linkUploadURL="/editor/filemanager/upload/simpleuploader?Type=File"
		flashUploadURL="/editor/filemanager/upload/simpleuploader?Type=Flash">
</FCK:editor>
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				图片上传
			</td>
			<td>
				<html:file property="titleimage" />
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				语音上传
			</td>
			<td>
				<html:file property="audourl" />
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				排序号
			</td>
			<td>
				<html:text property="ordering" />
			</td>
		</tr>
		<tr>
			<td class='pageTd' width="100">
				状态标志
			</td>
			<td>
			<select name="active" > 
				<option value="<%=Special.ACTIVE_COMM%>">普通</option>
				<option value="<%=Special.ACTIVE_HOT%>">热点</option> 
				<option value="<%=Special.ACTIVE_TOP%>">头条</option> 
				<option value="<%=Special.ACTIVE_HOT_TOP%>">热点并且头条</option>
			</select>
			</td> 
		</tr>
		<tr>
			<td colspan=2 align="center">
				<input type="submit" value="保存">
			</td>
		</tr>
	</table>
</html:form>
